from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from cqssc.db.orm.collection_log import CollectionLog


class Log:

    def addLog(self, **kwargs):
        engine = create_engine("mysql+pymysql://root:@127.0.0.1:3306/cqssc", max_overflow=5)
        session = sessionmaker(bind=engine)()
        log = CollectionLog(**kwargs)
        session.add(log)
        session.commit()
        session.close()
